<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<script type="text/javascript" src="<%=request.getContextPath()%>/resource/js/jquery-1.8.3.min.js"></script>
<link href="<%=request.getContextPath()%>/resource/css/index3.css" rel="stylesheet">

</head>
<body>
	<center>
		${student.name}同学您好，以下为您的入住记录
		<form action="stuList" method="post">
			<input type="submit" value="查看住宿记录">
		</form>
		<table>
			<tr>
				<td>住宿楼</td>
				<td>宿舍</td>
				<td>入住时间</td>
				<td>离开时间</td>
			</tr>
			<c:forEach items="${list}" var="r">
				<tr>
					<td>${r.fname }</td>
					<td>${r.dname }</td>
					<td><fmt:formatDate value="${r.startTime}"/></td>
					<td>
						<c:if test="${r.endTime==null }">
							至今
						</c:if>
						<c:if test="${r.endTime!=null }">
							
							<fmt:formatDate value="${r.endTime}"/>
						</c:if>
					</td>
				</tr>
			</c:forEach>
		</table>
	
	</center>
</body>
</html>